home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / include / incl98.zoo / utmp.h < prev    next >
C/C++ Source or Header  |  1993-11-05  |  880b  |  39 lines

  1. #ifndef _UTMP_H
  2. #define _UTMP_H
  3.  
  4. #ifndef _COMPILER_H
  5. #include <compiler.h>
  6. #endif
  7.  
  8. /*
  9.  * Structure of utmp and wtmp files.
  10.  *
  11.  */
  12. struct utmp {
  13.     char    ut_line[8];        /* tty name */
  14.     char    ut_name[8];        /* user id */
  15.     char    ut_host[16];        /* host name, if remote */
  16.     long    ut_time;        /* time on */
  17. };
  18.  
  19. /*
  20.  * This is to determine if a utmp entry does not correspond to a genuine user
  21.  * (pseudo tty)
  22.  */
  23.  
  24. #define nonuser(ut) ((ut).ut_host[0] == 0 && \
  25.         strncmp((ut).ut_line, "tty", 3) == 0 \
  26.             && ((ut).ut_line[3] == 'p' \
  27.             || (ut).ut_line[3] == 'q' \
  28.             || (ut).ut_line[3] == 'r' \
  29.             || (ut).ut_line[3] == 's'))
  30.  
  31. /* Prototypes */
  32.  
  33. __EXTERN void _write_utmp __PROTO((const char *line, const char *name,
  34.                     const char *host, unsigned long time));
  35. __EXTERN void _write_wtmp __PROTO((const char *line, const char *name,
  36.                     const char *host, unsigned long time));
  37.  
  38. #endif /* _UTMP_H */
  39.